﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleServiceBus.Bus.MessageManagement;

namespace SimpleServiceBus.Bus.Pipeline.PipelineComponents
{
    public class MessageHeaderGeneratorComponent : PipelineComponentBase
    {
        protected override void ProcessMessage(MessageEnvelope messageEnvelope, IMessageContext context)
        {
            var typeManager = context.GetLocalService<IMessageTypeManagementService>();
            if (typeManager != null)
                typeManager.GenerateMessageHeaders(messageEnvelope, context);
        }
    }
}
